float[][] Elements;
SystemType[] SystemTypes; //contains the system type data
StarType[] StarTypes; //contains the star type data
PlanetType[] PlanetTypes;
SolarSystem mySystem;
int NUM = 100;
PVector[] exppos;
PVector[] expvel;
PFont fontA;

void elementsSetup() {
  
  exppos = new PVector[NUM];
    expvel = new PVector[NUM];
    for( int i = 0; i < NUM; i++ ) {
      exppos[i] = new PVector(0,-height/2);
      expvel[i] = new PVector(random(-10,10), random (-15,15));
    }
    
  fontA = loadFont("SakkalMajallaBold-30.vlw");

  // Set the font and its size (in units of pixels)
  textFont(fontA, 32);
  
  Elements = new float[10][5];
  float[] Elements0 = {1.4*sunRadius, 0.8*sunRadius, 237, 238, 189};
  Elements[0] = Elements0;
  float[] Elements1 = {1.5*earthRadius, 0.5*earthRadius, 183, 251, 150};
  Elements[1] = Elements1;
  float[] Elements2 = {15*sunRadius, 2.5*sunRadius, 206, 244, 8};
  Elements[2] = Elements2;
  float[] Elements3 = {15*earthRadius, 7*earthRadius, 219, 193, 155};
  Elements[3] = Elements3;
  float[] Elements4 = {1.6*sunRadius, 1.0*sunRadius, 231, 235, 235};
  Elements[4] = Elements4;
  float[] Elements5 = {12*earthRadius, 6*earthRadius, 218, 207, 232};
  Elements[5] = Elements5;
  float[] Elements6 = {0.4*earthRadius, 0.2*earthRadius, 197, 196, 198};
  Elements[6] = Elements6;
  float[] Elements7 = {1.2*sunRadius, 0.6*sunRadius, 250, 176, 71};
  Elements[7] = Elements7;
  float[] Elements8 = {0.9*earthRadius, 0.5*earthRadius, 250, 227, 71};
  Elements[8] = Elements8;
  float[] Elements9 = {0.5*sunRadius, 0.3*sunRadius, 208, 12, 7};
  Elements[9] = Elements9;

  String[] starrows = loadStrings("suntypes.txt");
  String[] planetrows = loadStrings("planettypes.txt");
  String[] systemrows = loadStrings("systemtypes.txt");

  SystemTypes = new SystemType[systemrows.length]; //contains the system type data
  StarTypes = new StarType[starrows.length]; //contains the star type data
  PlanetTypes = new PlanetType[planetrows.length]; //contains the planet type data

  //get the star types
  for (int i = 0; i < starrows.length-2;i++)
  {
    String[] myStar1 = split(starrows[i+2], ',');
    String[] myStar2 = new String[myStar1.length-1];
    float[] starData = new float[myStar1.length-1];
    for (int j = 0; j < myStar1.length-1;j++)
    {
      myStar2[j] = myStar1[j];
    }
    starData = float(myStar2);
    StarTypes[i] = new StarType(starData, myStar1[myStar1.length-1]);
  }

  //get the planet types
  for (int i = 0; i < planetrows.length-2;i++)
  {
    String[] myPlanet1 = split(planetrows[i+2], ",");
    float[] planetData = new float[myPlanet1.length];
    planetData = float(myPlanet1);
    PlanetTypes[i] = new PlanetType(planetData);
  }

  //get the system types
  for (int i = 0; i < systemrows.length-2;i++)
  {
    String[] mySystem1 = split(systemrows[i+2], ",");
    String[] mySystem2 = new String[mySystem1.length-1];
    int[] systemData = new int[mySystem1.length-1];
    for (int j = 0; j < mySystem1.length-1;j++)
    {
      mySystem2[j] = mySystem1[j];
    }
    systemData = int(mySystem2);
    SystemTypes[i] = new SystemType(systemData, mySystem1[mySystem1.length-1]);
  }
  
  mySystem = new SolarSystem(0);
}

/*void draw()
{
  //mySystem.displaySystem();
}*/
